import HttpApi from '@/util/request'

// 根据用户id查询当前用户已做的关注配置
export function getConfSubscribeList ({ userid = '', constatus = 1 } = {}) {
  return new HttpApi({
    method: 'post',
    url: '/zlcx2/confSubscribe/getConfSubscribeList'
  })
}

// 根据用户id查询当前用户是否存在关注内容，是否需要实时上传gps位置信息
export function querySubscribe ({ userid = '' } = {}) {
  return new HttpApi({
    method: 'post',
    url: '/zlcx2/confSubscribe/querySubscribe'
  })
}

// 根据用户ID、收费站或服务区ID、关注内容（content:1.服务区关注 2.收费站关注 3高速路况关注）查询该收费站或服务区是否关注
export function queryIsSubscribed ({ userid = '', content = '', stations = '' } = {}) {
  return new HttpApi({
    method: 'post',
    url: '/zlcx2/confSubscribe/isSubscribed'
  })
}

// 写入关注信息
/*
 * @userid: 登录用户id
 * @subtype：关注类型， 1：全部关注，2：部分关注，例： 如果subtype = 1 ,content = 1, 则表示关注所有服务区
 * @content: 关注内容，1：服务区关注， 2：收费站关注， 3：高速路况关注，4：城市路况关注，单选
 * @contentsub：关注子选项，1.停车位信息紧张，2.加油站油品紧张，3收费站开闭信息，4高速拥堵信息，5.高速事故信息，6.恶劣天气，7.大流量，8.高速施工信息，9.其它
 *   contentsub的值，如果关注多个，则用逗号隔开，如 '1,2';
 *   content与contentsub对应关系：
 *     content: 1, contentsub: '1,2'
 *     content: 2, contentsub: '3'
 *     content: 3, contentsub: '4,5,6,7,8,9'
 *     content: 4, contentsub: ''
 * @stations: 需要提醒的 收费站|服务区|道路 的ID列表,多个以逗号隔开，如：'1,2,3,4,5';
 * @method: 消息提醒方式, 1.语音 2.消息 3.语音+消息 。提醒方式至少选择1个
 * @distance: 消息提醒距离，单位公里，如无需使用距离提醒，则传值0；
 * */
export function insertConfSubscribe ({
  userid = '',
  subtype = 1,
  content = '',
  contentsub = '',
  stations = '',
  method = 2,
  distance = 2
} = {}) {
  return new HttpApi({
    method: 'post',
    url: '/zlcx2/confSubscribe/insertConfSubscribe'
  })
}

// 向服务器发送位置信息
export function interactiveLocation ({ userid = '', lon = '', lat = '' } = {}) {
  return new HttpApi({
    method: 'post',
    url: '/zlcx2/confSubscribe/interactiveLocation'
  })
}

// 关注单个信息
export function addConfSubscribe ({
  userid = '',
  subtype = 2,
  content = '',
  contentsub = '',
  stations = '',
  method = 2,
  distance = 2
} = {}) {
  return new HttpApi({
    method: 'post',
    url: '/zlcx2/confSubscribe/addConfSubscribe'
  })
}

// 单个取消关注
export function cancelConfSubscribe ({
  userid = '',
  subtype = 2,
  content = '',
  contentsub = '',
  stations = '',
  method = 2,
  distance = 2
} = {}) {
  return new HttpApi({
    method: 'post',
    url: '/zlcx2/confSubscribe/cancelConfSubscribe'
  })
}

// 根据用户id查询关注topic的列表
export function querySubscribeTopics ({ userid = '' } = {}) {
  return new HttpApi({ method: 'get', url: '/zlcx2/confSubscribe/getTopics' })
}

// 用户写入城市路况点位
export function insertDicCityEventPoint ({ userid = '', lat = '', lon = '', road = '' } = {}) {
  return new HttpApi({
    method: 'post',
    url: '/zlcx2/dicCityEventPoint/insertDicCityEventPoint'
  })
}

// 根据用户id查询推送消息列表
export function getMessageListById ({ userid = '', current = 1, size = 10 } = {}) {
  return new HttpApi({
    method: 'post',
    url: '/zlcx2/userMessage/getMessageListById'
  })
}
// 获取推送信息列表
// eslint-disable-next-line no-empty-pattern
export function getPushMessage ({} = {}) {
  return new HttpApi({
    method: 'get',
    url: '/zlcx2/userMessage/getPushMessage'
  })
}
// 分页查询用户推送消息
export function getUserMessage ({ userid = '', current = 1, size = 10 } = {}) {
  return new HttpApi({
    method: 'post',
    url: '/zlcx2/userMessage/page'
  })
}

// 推送消息根据用户id
export function getconfSubscribeById ({ userid = '', current = 1, size = 10 } = {}) {
  return new HttpApi({
    method: 'post',
    url: '/zlcx2/confSubscribe/page'
  })
}
// 获取用户伴随式走廊订阅信息
// eslint-disable-next-line no-empty-pattern
export function getUserConSubcribe ({} = {}) {
  return new HttpApi({
    method: 'get',
    url: '/zlcx2/confSubscribe/getUserConSubcribe'
  })
}
// 更新用户关注内容
export function updateSubContent ({ content = '', contentsub = '' } = {}) {
  return new HttpApi({
    method: 'post',
    url: '/zlcx2/confSubscribe/updateSubContent',
    mixedQuery: true
  })
}
// 更新用户关注范围
export function updateSubStations ({ userid = '', current = 1, size = 10 } = {}) {
  return new HttpApi({
    method: 'post',
    url: '/zlcx2/confSubscribe/updateSubStations',
    mixedQuery: true
  })
}
// 获取订阅收费站信息
// eslint-disable-next-line no-empty-pattern
export function gethwTsInfo ({} = {}) {
  return new HttpApi({
    method: 'get',
    url: '/zlcx2/confSubscribe/hwTsInfo',
    mixedQuery: true
  })
}
